package com.zhny.sensor;

import com.zhny.sensor.entity.User;
import com.zhny.sensor.service.BarcodeMachineUserService;
import com.zhny.sensor.service.UserService;

import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@SpringBootTest(classes = App.class)
@RunWith(SpringRunner.class)
public class test2 {
    @Autowired
    private BarcodeMachineUserService barcodeMachineUserService;

    @Autowired
    private UserService userService;


    @org.junit.Test
    public void test(){
        User user = userService.findByIdCard(barcodeMachineUserService.getBarcodeMachineUser("030303030303").getMaintenanceId());
        System.out.println(user.getPhone());
    }

    @org.junit.Test
    public void test1(){
        List<User> list = userService.queryUsers("2", "https://u.wechat.com/MAASYKzdSoxH7VpRKdD0gQk");
        for (User u : list) {
            System.out.println(u);
        }
    }
}
